﻿const prefSearchDirectory = "SearchDirectory";
const prefOutputFileName = "OutputFileName";
const prefDefaultLocale = "DefaultLocale";

var pref = require('sdk/simple-prefs');

exports.getSearchDirectory = getSearchDirectory;
exports.getOutputFileName = getOutputFileName;
exports.getDefaultLocale = getDefaultLocale;

exports.attachChangeHandler = attachChangeHandler;
exports.prefSearchDirectory = prefSearchDirectory;

function attachChangeHandler(prefName, handler)
{    
    pref.on(prefName, handler);
}

function getSearchDirectory()
{    
    return pref.prefs[prefSearchDirectory];
}

function getOutputFileName()
{
    return pref.prefs[prefOutputFileName];
}

function getDefaultLocale()
{
    return pref.prefs[prefDefaultLocale];
}